import client from './client'

export function createTopic(payload: any) {
  return client.post('/social/topics', payload)
}

export function listTopics() {
  return client.get('/social/topics')
}

export function updateTopic(id: string, payload: any) {
  return client.put(`/social/topics/${id}`, payload)
}

export function deleteTopic(id: string) {
  return client.delete(`/social/topics/${id}`)
}

export function createTasks(topicId: string, payload: any) {
  return client.post(`/social/tasks/topics/${topicId}`, payload)
}

export function listTasks() {
  return client.get('/social/tasks')
}

export function runTask(taskId: string) {
  return client.post(`/social/tasks/${taskId}/run`)
}

export function queryContents(payload: any) {
  return client.post('/social/contents/query', payload)
}
